<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="../lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]--><title>信息查看</title>
</head>
<body>
<input type="hidden" id="emp_id">
<div class="cl pd-20" style=" background-color:#5bacb6">
  <img class="avatar size-XL l" src="../static/h-ui/images/user.png">
  <dl style="margin-left:100px; color:#fff">
    <dt><span class="f-18" id="emp_name">张三</span></dt>
    <!--<dt><span class="f-18" id="emp_account">账号</span></dt>-->
    <dd class="pt-10 f-12" style="margin-left:0" id="emp_desc">这家伙很懒，什么也没有留下</dd>
  </dl>
  <div style="margin-left:450px;margin-top:-45px">
    <button class="btn btn-danger radius" id="updatePass">重置密码</button>
  </div>
</div>
<div class="pd-20">
  <table class="table">
    <tbody>
      <tr>
        <th class="text-r" width="80">登录账号：</th>
        <td><span id="emp_account">部门</span></td>
      </tr>
      <tr>
        <th class="text-r" width="80">部门：</th>
        <td><span id="dept_name">部门</span></td>
      </tr>
      <tr>
        <th class="text-r" width="80">性别：</th>
        <td><span id="emp_sex">男</span></td>
      </tr>
      <tr>
        <th class="text-r">手机：</th>
        <td><span id="emp_phone">13112345678</span></td>
      </tr>
      <tr>
        <th class="text-r">邮箱：</th>
        <td><span id="emp_email">admin@mail.com</span></td>
      </tr>
      <tr>
        <th class="text-r">入职日期：</th>
        <td><span id="emp_in_date">2017-05-01</span></td>
      </tr>
    </tbody>
  </table>
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="../lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="../lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="../lib/jquery.validation/1.14.0/jquery.validate.min.js"></script>
<script type="text/javascript" src="../lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="../lib/jquery.validation/1.14.0/messages_zh.min.js"></script>
<script type="text/javascript" src="../static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="../MyJs/date_string.js"></script>
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
    $(function() {
        $(window).load(function () {
            init();
            getEmployeeById();
        });
        //修改密码
        $("#updatePass").click(function(){
            var emp_id = $("#emp_id").val();
            layer_show("重置密码" , "../employee/change-password.html?id="+emp_id , 600, 510 );
        });
    });

    //获取请求参数，name: 请求中参数的名字，返回参数的值
    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }

    function getEmployeeById() {
        var id = getQueryString("id");
        if(id != null){
            $.post("/staffing/employee/getEmployeeById.do",{"empId":id},function(data){
                if(data != null){
                    $("#emp_id").val(data.emp_id);
                    $("#emp_name").html(data.emp_name);
                    $("#emp_account").html(data.emp_account);
                    $("#emp_desc").html(data.emp_desc);
                    $("#dept_name").html(data.dept_name);
                    $("#emp_sex").html(data.emp_sex);
                    $("#emp_phone").html(data.emp_phone);
                    $("#emp_email").html(data.emp_email);
                    $("#emp_in_date").html(data.emp_in_date);
                }
            },"json");
        }
    }
    function init() {
        $.post("/user/getEmployee.do",function(data){
            if(data != null){
               if(data.emp_dept_id != 6){
                   $("#updatePass").remove();
               }
            }
        },"json");
    }

</script>
</body>
</html>